//
//  YbrClockDao.h
//  wifibox
//
//  Created by os X 10.9 on 14-12-9.
//  Copyright (c) 2014年 yinbaner. All rights reserved.
//

#import <Foundation/Foundation.h>
@class YbrNoTimeList;

@interface YbrClockDao : NSObject

-(YbrNoTimeList *) createTimer:(int) timerid;
-(BOOL)copyClockById:(int)timerid newClockName:(NSString *)newClockName;
-(NSArray *) getAllClock;   // 这里的arr存放是YbrClockItem对象
-(BOOL) addClock:(NSString *)name;
-(BOOL) addDownClock:(NSString *)name uuid:(NSString *)uuid; //新添
-(int) getTimerIdByuuid:(NSString *) uuid;
-(int) isHaveUuid:(NSString *) uuid ;
-(int) isHaveClockName:(NSString *) name;

-(NSString *) getTimerNameById:(int) timerid;
-(NSArray *) getClockByWeekday:(int) timerid weekday:(int) weekday; // 这里存放的是YbrClockTimerItem对象
-(NSArray *) getClockBeginAndEndByWeek:(int) weekday timerid:(int) timerid; // 获得现在这个日期当中的所有开始和结束的日期
-(int) getAllMusicTime:(int)clocktimeId;// 获得这个时间段的所有时间的总和

-(BOOL) addMusicToWeekDay:(NSArray *) musicChoose  weekDay:(int)weekDay timerid:(int)timerid begintime:(int)begintime endtime:(int)endtime;// 添加Array music到时间数据库中
-(int) getClockTimeId:(int) timerId weekday:(int) weekday beginTime:(int)beginTime endTime:(int) endTime;
-(NSArray *) getMusicListByWeekAndBegin:(int) _id;// arr 是YbrMusicItem
-(BOOL) delOldTime:(int) clocktimeId;

// 这个里面有YbrClockTimerItem YbrMusicItem对象和
//-(FMResultSet *) copyContent:(int) clocktimeId;
// 拷贝的是开始时间和结束时间
-(NSArray *) copyTime:(int) clocktimeId;
-(BOOL) deleTimerByTimerIdAndWeek:(int) timerid weekday:(int) weekday timerInt:(NSArray *) timerInt;
-(BOOL) addCopyContent:(int) copyClockTimeId timerid:(int) timerid weekday:(int) weekday;
-(int) getWeekItemTimeLeng:(int) clocktimeId;// 获得这个Item的音频的时间总长度
-(int) getWeekItemAllTimeLeng:(int) _id;// 获得这个Item的定时长度
-(BOOL) replaceTimerContent:(int)copyClockTimeId clocktimeId:(int) clcoktimeId;// 替换相应时间的内容
-(BOOL) copyWeekday:(int) timerid weekday:(int) weekday checks:(NSArray *) checks;// 复制内容到某些星期(checks表示已经选择的)
-(BOOL) deleMusic:(int) clocktimeId;
-(BOOL) addTimerOnly:(int) timerid weekday:(int) weekday beginTime:(int) beginTime endTime:(int) endTime;
-(BOOL) getIsOpen:(int) _id;
-(BOOL) setIsOpen:(int) _id flag:(BOOL) flag;
-(BOOL) deleClockTimer:(int) clockid;// 删除整个定时(同时删除三个表, 先删除音乐表, 再删除时间表, 再删除定时表)
-(BOOL) renameClock:(int) _id rename:(NSString *) rename;
-(NSString *) getClockNameById:(int) _id;
-(BOOL) clearWeekdayTime:(int) timerId weekdays:(NSArray *) weekdays;
-(NSString *) getClockNameNoRep:(NSString *) name;


-(NSMutableArray *) getClockTimeMusics:(int) copyClockTimeId;

@end
